//
//  ViewController.m
//  0218
//
//  Created by student on 16/2/18.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UIAlertViewDelegate,UIActionSheetDelegate>
@property (weak, nonatomic) IBOutlet UILabel *infoLabel;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)btn1Pressde:(id)sender {
    UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"标题" message:@"信息" delegate:self cancelButtonTitle:@"确定" otherButtonTitles: nil];
    [alterView show];
}
- (IBAction)btn2Pressed:(id)sender {
     UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"弹出窗口2" message:@"是丁金铭？" delegate:self cancelButtonTitle:@"是" otherButtonTitles: @"不是",nil];
    [alterView show];
}
- (IBAction)btn3Pressed:(id)sender {
    UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"登入" message:@"请输入用户名密码" delegate:self cancelButtonTitle:@"取消" otherButtonTitles: @"确定",nil];
    alterView.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput;
    [alterView show];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    NSLog(@"用户点了第%i个按钮 ，按钮的信息是：%@",buttonIndex+1,[alertView buttonTitleAtIndex:buttonIndex]);
    NSLog(@"弹窗的信息是：%@",alertView.title);
    
    if([alertView.title isEqualToString:@"登入"])
    {
        NSString *info = [NSString stringWithFormat:@"用户名:%@ 密码:%@",[alertView textFieldAtIndex:0].text,[alertView textFieldAtIndex:1].text];
        self.infoLabel.text = info;
    }

}

// 取消的时候
- (void)alertViewCancel:(UIAlertView *)alertView NS_DEPRECATED_IOS(2_0, 9_0);
{
    NSLog(@"%s",__FUNCTION__);
}

// 将要弹出的时候
- (void)willPresentAlertView:(UIAlertView *)alertView
{
    NSLog(@"%s",__FUNCTION__);
}

// 已经弹出
- (void)didPresentAlertView:(UIAlertView *)alertView
{
    NSLog(@"%s",__FUNCTION__);
}

// 将要消失
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
{
    NSLog(@"%s",__FUNCTION__);
}

// 已经消失
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
    NSLog(@"%s",__FUNCTION__);
}
#pragma mark - 弹出操作表(UIActionSheet)

#pragma mark - UIActionSheetDelegate Method 操作表的代理方法


#pragma mark - 整个应用有哪些对象 
/**
 *
 */














@end
